import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import * as svgCaptcha from 'svg-captcha';
import { v4 as uuidv4 } from 'uuid';
import Redis from 'ioredis';
import { redis } from 'ioredis';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}
  
  const redisClient = new Redis({
    host: localhost
  })


  @Get()
  getHello(): any {

    const capcha = svgCaptcha.create();
    const text = capcha.text;
    const data = capcha.data;
    const token = uuidv4();
    return {data, token };
  }
}
